<?php

/**
 * This is the model class for table "t_paramsp".
 *
 * The followings are the available columns in table 't_paramsp':
 * @property string $HEADER1
 * @property string $HEADER2
 * @property string $HEADER3
 * @property string $HEADER4
 * @property string $KEPADAYTH
 * @property string $KOTAYTH
 * @property string $NOSURAT
 * @property string $TGSURAT
 * @property string $KOTA
 * @property string $NIP
 * @property string $JNSPARAM
 * @property string $ISIPARAM
 * @property string $TEMBUSAN1
 * @property string $TEMBUSAN2
 * @property string $TEMBUSAN3
 * @property string $TEMBUSAN4
 * @property integer $ID
 */
class TParamsp extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return TParamsp the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 't_paramsp';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('HEADER1, HEADER2, HEADER3, HEADER4, TEMBUSAN1, TEMBUSAN2, TEMBUSAN3, TEMBUSAN4', 'length', 'max'=>100),
			array('KEPADAYTH', 'length', 'max'=>200),
			array('KOTAYTH, NOSURAT, KOTA', 'length', 'max'=>50),
			array('NIP', 'length', 'max'=>9),
			array('JNSPARAM', 'length', 'max'=>1),
			array('ISIPARAM', 'length', 'max'=>6),
			array('TGSURAT', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('HEADER1, HEADER2, HEADER3, HEADER4, KEPADAYTH, KOTAYTH, NOSURAT, TGSURAT, KOTA, NIP, JNSPARAM, ISIPARAM, TEMBUSAN1, TEMBUSAN2, TEMBUSAN3, TEMBUSAN4, ID', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'HEADER1' => 'Header1',
			'HEADER2' => 'Header2',
			'HEADER3' => 'Header3',
			'HEADER4' => 'Header4',
			'KEPADAYTH' => 'Kepadayth',
			'KOTAYTH' => 'Kotayth',
			'NOSURAT' => 'Nosurat',
			'TGSURAT' => 'Tgsurat',
			'KOTA' => 'Kota',
			'NIP' => 'Nip',
			'JNSPARAM' => 'Jnsparam',
			'ISIPARAM' => 'Isiparam',
			'TEMBUSAN1' => 'Tembusan1',
			'TEMBUSAN2' => 'Tembusan2',
			'TEMBUSAN3' => 'Tembusan3',
			'TEMBUSAN4' => 'Tembusan4',
			'ID' => 'ID',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('HEADER1',$this->HEADER1,true);
		$criteria->compare('HEADER2',$this->HEADER2,true);
		$criteria->compare('HEADER3',$this->HEADER3,true);
		$criteria->compare('HEADER4',$this->HEADER4,true);
		$criteria->compare('KEPADAYTH',$this->KEPADAYTH,true);
		$criteria->compare('KOTAYTH',$this->KOTAYTH,true);
		$criteria->compare('NOSURAT',$this->NOSURAT,true);
		$criteria->compare('TGSURAT',$this->TGSURAT,true);
		$criteria->compare('KOTA',$this->KOTA,true);
		$criteria->compare('NIP',$this->NIP,true);
		$criteria->compare('JNSPARAM',$this->JNSPARAM,true);
		$criteria->compare('ISIPARAM',$this->ISIPARAM,true);
		$criteria->compare('TEMBUSAN1',$this->TEMBUSAN1,true);
		$criteria->compare('TEMBUSAN2',$this->TEMBUSAN2,true);
		$criteria->compare('TEMBUSAN3',$this->TEMBUSAN3,true);
		$criteria->compare('TEMBUSAN4',$this->TEMBUSAN4,true);
		$criteria->compare('ID',$this->ID);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}